import {request} from "vendor/utils/T";
import {toApi} from '@/service/proxyApi';
import {  RespSysDataType } from "./apiType";

export * from "./apiType";

const { get } = request;

/**
 * 获取允许用户使用的角色列表
 */
export const getAllowUserUseRoles = () => get<RespSysDataType.AllowUserUseAdminRoleItem[]>(toApi("api/v1/system/adminRole/getAllowUserUseRoles"))

/**
 * 获取代理商select list
 */
export const getAgentSelectList = () => get<RespSysDataType.AgentSelectList>(toApi("api/v1/system/agent/select"))

/**
 * 获取字典数据
 */
export const getDictData = (params: {dictType: string, defaultValue?: string}) => get<RespSysDataType.DictData>(toApi("api/v1/system/dict/data/getDictData"), params)

/**
 * 获取用户依赖数据
 */
export const getUserDependParams = () => get<RespSysDataType.UserDependParams>(toApi("api/v1/system/user/params"))

/**
 * 获取组织树
 */
export const getDeptTree = () => get<RespSysDataType.DeptTreeResp>(toApi("api/v1/system/dept/treeSelect"))
